/* 
 * File:   FileCachedCleanTimer.h
 * Author: dell
 *
 * Created on 2012年11月21日, 下午4:47
 */

#ifndef FILECACHEDCLEANTIMER_H
#define	FILECACHEDCLEANTIMER_H

#include "common.h"
#include <evhttp/Timer.h>
#include "config/RapidConfigManager.h"
#include "config/ServerConfig.h"
#include <sys/stat.h>
#include <time.h>
#include "FileCached.h"
#include "ProcessMessage.h"

namespace Rapid{
    
    class FileCachedCleanTimer : public Timer{
    public:
        FileCachedCleanTimer(RapidConfigManager* rapidConfigManager);
        virtual ~FileCachedCleanTimer();

        
    protected:
        virtual bool onTimerEvent(const TimerEvent* e);  

        
    private:
        RapidConfigManager* rapidConfigManager;
        
        typedef hash_map<const char*, struct stat, hash<const char*>, HashMapStrIgnoreCaseCompare> ContextBaseStatMap;
        ContextBaseStatMap contextBaseStatMap;  

        typedef hash_map<int, FileCached*> FileCachedMap;
        FileCachedMap fileCachedMap;
        
        //FileCached fileCached;
        ProcessMessage processMessage;
//        vector<FileCached*> fileCacheds;
        
        
        void init();
    };

}
#endif	/* FILECACHEDCLEANTIMER_H */

